Don't refuse to clean up after a domain death when the buffer is not empty. If
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 30 Nov 2005 18:48:27 +0000 (18:48 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 30 Nov 2005 18:48:27 +0000 (18:48 +0000)
the domain has gone away, then no-one can attach to the pty because Xend will
have cleaned up the entries in the store, so the pty will never become ready to
write.  The buffer will never get emptied, so cleanup will never occur. This
leaks ptys, file descriptors, and memory.  Simply throw those data away instead.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/console/daemon/io.c

index 80e76c416efa7aaef21a708cc5c5222b1dcf9f1f..9aae032680af8cdb7e7d5180d0015a895f489c4e 100644 (file)
@@ -376,9 +376,6 @@ static void remove_domain(struct domain *dom)
 
 static void cleanup_domain(struct domain *d)
 {
-       if (!buffer_empty(&d->buffer))
-               return;
-
        if (d->tty_fd != -1) {
                close(d->tty_fd);
                d->tty_fd = -1;